import {request} from './Request';
//登录
export function login(id, password){
    return request({
        url:'/user/login',
        method:'post',
        data:{
            adminId:id,
            passwd:password
        }
    });
}
//获取用户信息
export function getInfo(){
    return request({
        url:'/user/getInfo',
        method:'get'
    });
}
//搜索用户
export function getAllUser(data){
    return request({
        url:'/user/getAllUser',
        method:'post',
        data:{
            adminId:data.adminId?data.adminId:null,
            name:data.name?data.name:null,
            adminText:data.adminText?data.adminText:null,
            permission:data.permission?data.permission:null
        }
    });
}   
//退出登录
export function logout(){
    return request({
        url:'/user/logout',
        method:'get'
    });
}   
//添加用户
export function addUser(data){
    return request({
        url:'/user/addUser',
        method:'post',
        data:data
    });
}
//删除用户
export function deleteUser(id){
    return request({
        url:'/user/deleteUser',
        method:'post',
        data:{
            adminId:id
        }
    });
}
//修改用户信息
export function updateUser(data){
    return request({
        url:'/user/updateUser',
        method:'post',
        data:data
    });
}       


